"""
数组的变维操作
"""
import numpy as np

ary = np.arange(1,9)

# 视图变维：数据共享，不会修改原始数据
bry = ary.reshape(2,4)
print(bry)
ary[0] = 666
print(bry)
print(bry.ravel())

# 复制变维
# bry = np.arange(1,9).reshape(2,4)
# cry = bry.flatten()
# bry[0] = 666
# print(cry)

# 就地变维：修改原始数据
# ary.resize(2,2,2)
# print(ary)

